package com.one.component;

import javax.swing.*;
import java.awt.*;

public class BackGroundPanel extends JPanel {
    //声明图片
    private Image backImage;
    public BackGroundPanel(Image backImage) {
        this.backImage = backImage;
    }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(backImage, 0, 0, this.getWidth(), this.getHeight(), null);
    }
}
